// 这里定义reducer函数,一个reducer函数独占一个js文件
import { ADD } from './contants'
export default function reducer(state = { count: 1 }, action) {
  switch (action.type) {
    case ADD:
      return {
        ...state,
        count: state.count + action.payload,
      }

    default:
      return state
  }
}
